<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="pu" uri="/WEB-INF/tld/pageutil.tld" %>
<%@taglib prefix="mu" uri="/WEB-INF/tld/mallutil.tld" %>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@taglib prefix="import" uri="/WEB-INF/tld/importTag.tld" %>
<%@taglib prefix="pageable" uri="/WEB-INF/tld/pageable.tld" %>
<script src="/js/pageable.js"></script>

<c-rt:set var="tp" value="${pu:pageableTag('tpp', 10, 10)}"/>
<c-rt:set var="hql">
from Orders where memberId=? order by createDate desc
</c-rt:set>
${pu:listAdd('params', '0000000222') }
<c-rt:set var="orders" value="${pu:queryByHql(hql, pu:arrayGet('params'), tp) }"/>
<table border="1">
<tr>
<td>receiverName</td>
<td>memberId</td>
<td>订单號</td><td>商品</td><td>動作</td>
</tr>
<c-rt:forEach items="${orders}" var="order">
<tr>
<td>
${order.receiverName }
</td>
<td>
${order.memberId }
</td>
<td>${order.orderId }</td><td>
<table>
<c-rt:forEach items="${order.orderProduct}" var="orderProduct">
<tr>
<td>${orderProduct.prodName }</td>
<td>
<a href="<c-rt:url value="/member/serviceOrder/toReturnProduct.do?orderProdId=${orderProduct.orderProdId}"/>">退货</a>
<a href="<c-rt:url value="/member/serviceOrder/toReturnProduct.do?orderId=${order.orderId }"/>">全退货</a>
<a href="<c-rt:url value="/member/serviceOrder/toChangeProduct.do?orderId=${order.orderId }&orderProdId=${orderProduct.orderProdId}"/>">換货</a>
<a href="<c-rt:url value="/member/fixInfo/fixInfo.do?orderProdId=${orderProduct.orderProdId }"/>">维修资讯</a>
</td>
<td>
<%--
<import:wrap url="/member/serviceOrder/toReturnProduct.do?orderProdId=${orderProduct.orderProdId}" key="key" appendParameter="orderProdId"></import:wrap>
 --%>

</td>
</tr>
</c-rt:forEach>
</table>
</td>
<td>
<a href="javascript:;" onclick="doAR('<c-rt:url value="/member/serviceOrder/toCancelOrder.do?orderId=${order.orderId }"/>', 'dialog');openDialog('取消订单');">取消订单</a>

</td>

</tr>
</c-rt:forEach>
</table>
<div id="dialog" style="display:none">

</div>
<import:around url="test.jsp" >
<table>
	<%
	System.out.println("xxxx");
	%>
	<tr>
	<td>123</td>
	</tr>
</table>

</import:around>

<pageable:Pageable url="" formname="aForm" key="tpp"></pageable:Pageable>
